package cn.distant.tank;

import java.io.IOException;
import java.util.Properties;

/**
 * @author distantstar
 * @version 1.0
 * @date 2021
 * @description cn.distant.tank
 * @since JDK1.8
 */
public class PropertiesMgr {
    private static Properties properties = null;

    static {
        properties = new Properties();
        try {
            properties.load(PropertiesMgr.class.getClassLoader().getResourceAsStream("config.properties"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object getKey(String key) {
        if (properties != null) {
            return properties.get(key);
        } else {
            return "";
        }
    }
}
